var r = require("../../@babel/runtime/helpers/interopRequireDefault")(
  require("../../@babel/runtime/helpers/defineProperty"),
);
function e(r, e) {
  (r[e >> 5] |= 128 << (24 - (e % 32))), (r[15 + (((e + 64) >> 9) << 4)] = e);
  for (
    var a = Array(80),
      i = 1732584193,
      c = -271733879,
      f = -1732584194,
      h = 271733878,
      l = -1009589776,
      b = 0;
    b < r.length;
    b += 16
  ) {
    for (var v = i, A = c, s = f, g = h, y = l, d = 0; d < 80; d++) {
      a[d] =
        d < 16 ? r[b + d] : o(a[d - 3] ^ a[d - 8] ^ a[d - 14] ^ a[d - 16], 1);
      var p = u(u(o(i, 5), n(d, c, f, h)), u(u(l, a[d]), t(d)));
      (l = h), (h = f), (f = o(c, 30)), (c = i), (i = p);
    }
    (i = u(i, v)), (c = u(c, A)), (f = u(f, s)), (h = u(h, g)), (l = u(l, y));
  }
  return Array(i, c, f, h, l);
}
function n(r, e, n, t) {
  return r < 20
    ? (e & n) | (~e & t)
    : r < 40
      ? e ^ n ^ t
      : r < 60
        ? (e & n) | (e & t) | (n & t)
        : e ^ n ^ t;
}
function t(r) {
  return r < 20
    ? 1518500249
    : r < 40
      ? 1859775393
      : r < 60
        ? -1894007588
        : -899497514;
}
function a(r, n) {
  var t = i(r);
  t.length > 16 && (t = e(t, 8 * r.length));
  for (var a = Array(16), u = Array(16), o = 0; o < 16; o++)
    (a[o] = 909522486 ^ t[o]), (u[o] = 1549556828 ^ t[o]);
  var c = e(a.concat(i(n)), 512 + 8 * n.length);
  return e(u.concat(c), 672);
}
function u(r, e) {
  var n = (65535 & r) + (65535 & e);
  return (((r >> 16) + (e >> 16) + (n >> 16)) << 16) | (65535 & n);
}
function o(r, e) {
  return (r << e) | (r >>> (32 - e));
}
function i(r) {
  for (var e = Array(), n = 0; n < 8 * r.length; n += 8)
    e[n >> 5] |= (255 & r.charCodeAt(n / 8)) << (24 - (n % 32));
  return e;
}
function c(r) {
  for (var e = "0123456789abcdef", n = "", t = 0; t < 4 * r.length; t++)
    n +=
      e.charAt((r[t >> 2] >> (8 * (3 - (t % 4)) + 4)) & 15) +
      e.charAt((r[t >> 2] >> (8 * (3 - (t % 4)))) & 15);
  return n;
}
module.exports = (0, r.default)(
  {
    hex_hmac_sha1: function (r, e) {
      return c(a(r, e));
    },
    binb2hex: c,
    str2binb: i,
  },
  "binb2hex",
  c,
);
